import { Controller, Get, Post, Query, Body } from "@nestjs/common";
import axios from "axios";
import { TranslateService } from "./translate.service";

@Controller("translate")
export class TranslateController {
  constructor(private readonly translateService: TranslateService) {}

  @Post("/fanyi")
  async fanyi(@Body() params) {
    console.log("params", params);
    return this.translateService.fanyi(params);
  }
  @Get("/gaoding_content") async gaodingContent(@Query() params) {
    const url = params.url;
    const data = await axios(url);
    return {
      data: data.data
    }
  }
}
